/*
 * @Description: 用户操作日志 - 接口
 * @Author:
 * @Date: 2022-03-11 23:12:12
 * @LastEditors: DHL
 * @LastEditTime: 2022-03-20 20:36:22
 */

import { $get, $post, $put } from '/@/utils/http'
import { ContentTypeEnum } from '/@/constant/http'
import {
  LogOperationModel,
  LogOperationPageParams,
  LogOperationPageResultModel,
  LogOperationResultModel
} from './model/logOperationModel'

/**
 * 分页查询
 */
export const apiLogOperationSearch = (searchParams: LogOperationPageParams) =>
  $get<LogOperationPageResultModel>({
    url: '/sys/twbLogOperation/search',
    params: searchParams
  })

/**
 * 根据ID获取详情
 */
export const apiLogOperationGetById = (id: string) =>
  $get<LogOperationResultModel>({
    url: '/sys/twbLogOperation/getById',
    params: { id: id }
  })

/**
 * 保存信息
 */
export const apiLogOperationSave = (saveParams: LogOperationModel) =>
  $post<LogOperationResultModel>({
    url: '/sys/twbLogOperation/save',
    contentType: ContentTypeEnum.json,
    params: saveParams
  })

/**
 * 更新信息
 */
export const apiLogOperationUpdateById = (updateParams: LogOperationModel) =>
  $put<LogOperationResultModel>({
    url: '/sys/twbLogOperation/updateById',
    contentType: ContentTypeEnum.json,
    params: updateParams
  })

/**
 * 根据ID删除信息
 */
export const apiLogOperationDeleteById = (id: string) =>
  $post<LogOperationResultModel>({
    url: '/sys/twbLogOperation/deleteById',
    params: { id: id }
  })

/**
 * 批量删除信息
 */
export const apiLogOperationBatchDeleteByIds = (ids: string) =>
  $post<LogOperationResultModel>({
    url: '/sys/twbLogOperation/batchDeleteByIds',
    params: { ids: ids }
  })

/**
 * 根据ID逻辑删除信息
 */
export const apiLogOperationLogicDeleteById = (id: string) =>
  $post<LogOperationResultModel>({
    url: '/sys/twbLogOperation/logicDeleteById',
    params: { id: id }
  })

/**
 * 批量逻辑删除
 */
export const apiLogOperationLogicBatchDeleteByIds = (ids: string) =>
  $post<LogOperationResultModel>({
    url: '/sys/twbLogOperation/logicBatchDeleteByIds',
    params: { ids: ids }
  })
